﻿using System.Data;
using System.Data.SqlClient;
namespace MyWeb.Data
{
	public class tblSTUDENT_RESERVEDAL : SqlDataProvider
	{

		#region[tblSTUDENT_RESERVE_GetbyAll]
		public DataTable tblSTUDENT_RESERVE_GetByAll()
		{
			using (var cmd = new SqlCommand("sp_tblSTUDENT_RESERVE_GetByAll", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				return GetTable(cmd);
			}
		}
		#endregion
		#region[tblSTUDENT_RESERVE_GetbyId]
		public DataTable tblSTUDENT_RESERVE_GetById(string STUDENT_RESERVE_ID)
		{
			using (var cmd = new SqlCommand("sp_tblSTUDENT_RESERVE_GetById", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STUDENT_RESERVE_ID", STUDENT_RESERVE_ID));return GetTable(cmd);
			}
		}
		#endregion
		#region[tblSTUDENT_RESERVE_GetbyTop]
		public DataTable tblSTUDENT_RESERVE_GetByTop(string Top, string Where, string Order)
		{
			using (var cmd = new SqlCommand("sp_tblSTUDENT_RESERVE_GetByTop", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				var da = new SqlDataAdapter(cmd);
				cmd.Parameters.Add(new SqlParameter("@Top",Top));
				cmd.Parameters.Add(new SqlParameter("@Where",Where));
				cmd.Parameters.Add(new SqlParameter("@Order",Order));
				return GetTable(cmd);
			}
		}
		#endregion
		#region[tblSTUDENT_RESERVE_GetbySTUDENT_ID]
		public DataTable tblSTUDENT_RESERVE_GetBySTUDENT_ID(string STUDENT_ID)
		{
			using (var cmd = new SqlCommand("sp_tblSTUDENT_RESERVE_GetBySTUDENT_ID", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STUDENT_ID", STUDENT_ID));
				var da = new SqlDataAdapter(cmd);
				var dt = new DataTable();
				da.Fill(dt);
				return dt;
			}
		}
		#endregion
		#region[tblSTUDENT_RESERVE_Insert]
		public void tblSTUDENT_RESERVE_Insert(tblSTUDENT_RESERVEInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblSTUDENT_RESERVE_Insert", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STUDENT_ID", Data.STUDENT_ID));
				cmd.Parameters.Add(new SqlParameter("@DATE_RESERVE", Data.DATE_RESERVE));
				cmd.Parameters.Add(new SqlParameter("@CREATOR", Data.CREATOR));
				cmd.Parameters.Add(new SqlParameter("@CREATED_DATE", Data.CREATED_DATE));
				cmd.Parameters.Add(new SqlParameter("@MODIFIER", Data.MODIFIER));
				cmd.Parameters.Add(new SqlParameter("@MODIFIED_DATE", Data.MODIFIED_DATE));
				ExeCuteNonquery(cmd);
			}
		}
		#endregion
		#region[tblSTUDENT_RESERVE_Update]
		public void tblSTUDENT_RESERVE_Update(tblSTUDENT_RESERVEInfo Data)
		{
			using (var cmd = new SqlCommand("sp_tblSTUDENT_RESERVE_Update", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STUDENT_RESERVE_ID", Data.STUDENT_RESERVE_ID));
				cmd.Parameters.Add(new SqlParameter("@STUDENT_ID", Data.STUDENT_ID));
				cmd.Parameters.Add(new SqlParameter("@DATE_RESERVE", Data.DATE_RESERVE));
				cmd.Parameters.Add(new SqlParameter("@CREATOR", Data.CREATOR));
				cmd.Parameters.Add(new SqlParameter("@CREATED_DATE", Data.CREATED_DATE));
				cmd.Parameters.Add(new SqlParameter("@MODIFIER", Data.MODIFIER));
				cmd.Parameters.Add(new SqlParameter("@MODIFIED_DATE", Data.MODIFIED_DATE));
				ExeCuteNonquery(cmd);
			}
		}
		#endregion
		#region[tblSTUDENT_RESERVE_Delete]
		public void tblSTUDENT_RESERVE_Delete(string STUDENT_RESERVE_ID)
		{
			using (var cmd = new SqlCommand("sp_tblSTUDENT_RESERVE_Delete", GetConnection()))
			{
				cmd.CommandType = CommandType.StoredProcedure;
				cmd.Parameters.Add(new SqlParameter("@STUDENT_RESERVE_ID",STUDENT_RESERVE_ID));
				ExeCuteNonquery(cmd);
			}
		}
		#endregion
	}
}